﻿using System;
using System.Collections.Generic;
using Bingosoft.Modules.SecurityConsole.Common.Helper;
using Bingosoft.Modules.SecurityConsole.Organization;
using Bingosoft.RestService.Attributes;

namespace Bingosoft.Modules.SecurityConsole.Common.FunctionControl.ListSelect.Organization
{
    [Service("AddRoleUser")]
    public class AddRoleUserService
    {
        [ServiceMethod]
        public bool Save(string oldIds, string oldNames, string newIds, string newNames, IDictionary<string, object> parameters)
        {
            OrganizationService service = new OrganizationService();
            String[] newIdsString = newIds.Split(',');
            string wfRoleId = DictionaryHelper.GetParamString(parameters, "ROLE_ID");
            return service.AddRoleUsers(wfRoleId, newIdsString);
        }
    }
}
